#ifndef _OCPP_NcVarWrapper_H__
#define _OCPP_NcVarWrapper_H__

#include "OCVolume/VolumeGridData.h"
#include "OCVolume/GridVariable.h"
#include "OCVolume/GridFileReader.h"
#include "NcDimWrapper.h"

namespace OCPP
{
	using namespace Volume;
	using NcVarList = std::vector<NcVar>;

	class NcVarWrapper : public GridVariable
	{
	public:
		NcVarWrapper(NcVar var, NetcdfFileReaderPtr ptr = nullptr);
		~NcVarWrapper()
		{

		}
		void addDimVar(std::shared_ptr<NcDimWrapper> dim, bool splitDimZ, bool mustBeZ, const VolumeOptions& options);

		const NcDimWrapperList& getDimList();

		bool hasDimTime = false;
		NcVar _var;
		NcShape _origin;
		NcShape _shape;
		VolumeGridData _ncGridData;
		NcDimWrapperList _ncDimList;

		//
		virtual StringVector getDims();
		virtual GridShape getShape();
		virtual String getName();

		virtual FloatVector readFloat();
		virtual String getUnitsString();
		virtual String getTimeString(int index);
		NetcdfFileReaderPtr _ncWrapperPtr;
	};
}


#endif // !_OCPP_NcTime_H__
